import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule} from '@angular/forms';
import { AppComponent } from './app.component';
import { NavbarComponent } from './navbar/navbar.component';
import { FooterComponent } from './footer/footer.component';
import { SearchComponent } from './search/search.component';
import { CarouselComponent } from './carousel/carousel.component';
import { ProductComponent } from './product/product.component';
import { StarsComponent } from './stars/stars.component';
import { ProductDetailComponent } from './product-detail/product-detail.component';
import { HomeComponent } from './home/home.component';
import { Routes, RouterModule,RouterOutlet } from '@angular/router';
import { productService } from './shared/product.service';
import { FilterPipe } from './pipe/filter.pipe';
import { WebSocketComponent } from './web-socket/web-socket.component';
import { webSocketService } from './shared/websocket.service';
import { HttpModule } from '@angular/http';
const RouterConfig:Routes = [
  {path:'',component:HomeComponent},
  {path:'product/:id',component:ProductDetailComponent}
];

@NgModule({
  declarations: [
    AppComponent,
    NavbarComponent,
    FooterComponent,
    SearchComponent,
    CarouselComponent,
    ProductComponent,
    StarsComponent,
    ProductDetailComponent,
    HomeComponent,
    FilterPipe,
    WebSocketComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    RouterModule.forRoot(RouterConfig),
    ReactiveFormsModule,
    HttpModule
  ],
  exports:[
    RouterModule//在没有使用--routing参数生成的时候需要将对应的RouterModule使用export导出一下
  ],
  providers: [productService,webSocketService],
  bootstrap: [AppComponent]
})
export class AppModule { }
